﻿<Window x:Class="MVVM.Demo.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MVVM.Demo"
    xmlns:Cinch="clr-namespace:Cinch;assembly=Cinch"
    xmlns:VM="clr-namespace:MVVM.ViewModels;assembly=MVVM.ViewModels"
	WindowStartupLocation="CenterScreen"  
    WindowState="Maximized"
    Icon="../Images/Orders.png"
    Title="Cinch.Demo : A demo app to showcase the Cinch assembly" 
    MinHeight="768" MinWidth="1024" 
    x:Name="view">




    <Window.Resources>

        <Storyboard x:Key="OnLoadedStoryBoard">
            <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="menu" Storyboard.TargetProperty="(FrameworkElement.Margin)">
                <SplineThicknessKeyFrame KeyTime="00:00:00" Value="0,-60,0,0"/>
                <SplineThicknessKeyFrame KeyTime="00:00:00.5000000" Value="0,0,0,0"/>
            </ThicknessAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rectangle" Storyboard.TargetProperty="(UIElement.Opacity)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0.2"/>
                <SplineDoubleKeyFrame KeyTime="00:00:00.8000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <PointAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="tabControl" Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)">
                <SplinePointKeyFrame KeyTime="00:00:00" Value="0.5,0.5"/>
                <SplinePointKeyFrame KeySpline="0,0,0.86,0.203" KeyTime="00:00:00.8000000" Value="0.5,0.5"/>
            </PointAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="tabControl" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.86,0.203" KeyTime="00:00:00.8000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.0000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="tabControl" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                <SplineDoubleKeyFrame KeySpline="0,0,0.86,0.203" KeyTime="00:00:00.8000000" Value="0"/>
                <SplineDoubleKeyFrame KeyTime="00:00:01.0000000" Value="1"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>


        <DataTemplate DataType="{x:Type VM:StartPageViewModel}">
            <AdornerDecorator>
                <local:StartPageView />
            </AdornerDecorator>
        </DataTemplate>


        <DataTemplate DataType="{x:Type VM:AddEditCustomerViewModel}">
            <AdornerDecorator>
                <local:AddEditCustomerView />
            </AdornerDecorator>
        </DataTemplate>

        <DataTemplate DataType="{x:Type VM:SearchCustomersViewModel}">
            <AdornerDecorator>
                <local:SearchCustomersView />
            </AdornerDecorator>
        </DataTemplate>


    </Window.Resources>
    
	<Window.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource OnLoadedStoryBoard}"/>
		</EventTrigger>
	</Window.Triggers>

	<Grid x:Name="grid">

 
        <Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>

        <Menu x:Name="menu" Margin="0,0,0,0" Height="Auto" Foreground="White"
              ItemContainerStyle="{StaticResource ContextMenuItemStyle}"
              ItemsSource="{Binding MenuOptions}"
              VerticalAlignment="Top" Background="#FF000000">
        </Menu>




        <Grid x:Name="rectangle" Grid.Row="1" Grid.Column="0"
			HorizontalAlignment="Stretch" 
			VerticalAlignment="Stretch">

            <Grid.RowDefinitions>
                <RowDefinition Height="80"/>
                <RowDefinition Height="2"/>
            </Grid.RowDefinitions>


            <Grid Grid.Row="0" Background="{StaticResource OutlookButtonHighlight}" 
                        HorizontalAlignment="Stretch" 
			            VerticalAlignment="Stretch">
                <StackPanel Orientation="Horizontal">
                    
                    <Image Source="../Images/Orders.png" 
                       HorizontalAlignment="Left" Height="70" Width="70"
                       Margin="10,0,10,0" VerticalAlignment="Center"/>
                    
                    <Label HorizontalAlignment="Left" VerticalAlignment="Center"
                           FontSize="16" FontFamily="Verdana" Foreground="Black"
                           FontWeight="Bold" 
                           Content="Simple LOB App Using MVVM/Mediator and LINQ to SQL"/>

                </StackPanel>
            </Grid>

            <Rectangle Grid.Row="1" Fill="Black" 
                        HorizontalAlignment="Stretch" 
			            VerticalAlignment="Stretch"/>

            

            
        </Grid>




        <local:TabControlEx x:Name="tabControl" Grid.Row="2" Grid.Column="0" 
                IsSynchronizedWithCurrentItem="True" 
                ItemsSource="{Binding Path=Workspaces}" 
                RenderTransformOrigin="0.5,0.5"
                Template="{StaticResource MainTabControlTemplateEx}">
            <local:TabControlEx.RenderTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="1"/>
                    <SkewTransform AngleX="0" AngleY="0"/>
                    <RotateTransform Angle="0"/>
                    <TranslateTransform X="0" Y="0"/>
                </TransformGroup>
            </local:TabControlEx.RenderTransform>
        </local:TabControlEx>


		
		
	</Grid>
</Window>
